package foreach;

public class ForeachArray {
	public static void main(String[] args) {
		String[] names = {"张乃升","田可馨","康淇溶","姜宏"};
		boolean[] graduated = {true,false,false,true};
		double[] heights = {1.9,1.69,1.55,1.62};
		char[] sex = {'男','女','女','女'};
		
		// 1.传统的for遍历使用下标来遍历
		for (int i = 0; i < names.length; i++) {
			System.out.println(names[i]);
		}
		// 2.增强for循环,走的值,name = names[0], name=names[1]
		for (String name : names) {
			System.out.println(name);
		}
	}
}
